﻿using Jst.IRepository.Repositories;
using Jst.Repository.SqlSugar.Repositories;
using Microsoft.Extensions.DependencyInjection;

namespace Jst.Repository.SqlSugar.Extensions
{
    public static class ServiceCollectionExtensions
    {
        public static IServiceCollection AddSqlSugarRepositories(this IServiceCollection services)
        {
            services.AddSingleton(typeof(IRepository<>), typeof(SugarRepository<>));
            services.AddScoped<IUnitOfWork, UnitOfWork.SugarUnitOfWork>();
            return services;
        }
    }
}